#include "../Source/server.hpp"

void TestBufferModule()
{
    Buffer buf;
    std::string str;
    for(int i = 0; i < 300; i++)
    {
        // str = str + std::to_string(i) + "hello!!!\n";
        std::string c = std::to_string(i) + " hello!!!\n";
        buf.WriteFromStringAndMove(c);
        std::cout << buf.ReadAbleSize() << std::endl;
    }
    buf.WriteFromStringAndMove(str);

    // std::cout << buf.ReadAbleSize() << std::endl;
    // for(int i = 0; i < 300; i++)
    // {
    //     std::string tmp = buf.GetLineAndMove();
    //     std::cout << tmp << std::endl;
    // }


    /*
    buf.WriteFromStringAndMove(str);
    Buffer buf1;
    buf1.WriteFromBufferAndMove(buf);

    std::string tmp;
    tmp = buf1.ReadAsStringAndMove(buf1.ReadAbleSize());

    std::cout << tmp << std::endl;
    std::cout << buf.ReadAbleSize() << std::endl;
    std::cout << buf1.ReadAbleSize() << std::endl;
    */
}

int main()
{
    TestBufferModule();
    return 0;
}